﻿using System.Collections.Generic;
using BulletSharp;
using System;

namespace Robot
{
    class Food
    {
        public RigidBody body;
        public Vector3 Position { get; private set; }

        public Food(Vector3 position, DynamicsWorld world)
        {
            
            Position = position;

            BoxShape shape = new BoxShape(0.25f);
            DefaultMotionState myMotionState = new DefaultMotionState(Matrix.Translation(position));
            RigidBodyConstructionInfo rbInfo = new RigidBodyConstructionInfo(0, myMotionState, shape);
            body = new RigidBody(rbInfo);
            world.AddRigidBody(body);
        }

        public void Remove(DynamicsWorld world)
        {
            world.RemoveRigidBody(body);
        }
    }
}
